import java.util.Calendar;
import java.util.Date;
import java.util.GregorianCalendar;

import br.com.r2.util.tipodado.Data;

public class TesteUnio
{
   public static void main(String[] args)
   {

      Calendar calendar = new GregorianCalendar();
      calendar.set(2011, 7, 20);
      
      Data data = new Data(calendar.getTime());
      System.out.println("Data passada: " + data);
      
      int actualMinimum = calendar.getActualMinimum(Calendar.DAY_OF_MONTH);
      int actualMaximum = calendar.getActualMaximum(Calendar.DAY_OF_MONTH);
      
      Calendar calendarNovo = new GregorianCalendar();
      Data dataInicio = new Data(new Date());
      Data dataFinal = new Data(new Date());
      
      calendarNovo.set(data.getAno().getValor(), data.getMes().getValor(), actualMinimum);
      dataInicio = new Data(calendarNovo.getTime());

      calendarNovo.set(data.getAno().getValor(), data.getMes().getValor(), actualMaximum);
      dataFinal = new Data(calendarNovo.getTime());
      
      System.out.println("Data Inicio: " + dataInicio);
      System.out.println("Data Final: " + dataFinal);
   }
}
